/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities_wegan;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wegan
 */
@Entity
@Table(name = "RUNTRACKERUSER", catalog = "", schema = "APP")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Runtrackeruser.findAll", query = "SELECT r FROM Runtrackeruser r"),
    @NamedQuery(name = "Runtrackeruser.findById", query = "SELECT r FROM Runtrackeruser r WHERE r.id = :id"),
    @NamedQuery(name = "Runtrackeruser.findByFirstname", query = "SELECT r FROM Runtrackeruser r WHERE r.firstname = :firstname"),
    @NamedQuery(name = "Runtrackeruser.findBySurname", query = "SELECT r FROM Runtrackeruser r WHERE r.surname = :surname"),
    @NamedQuery(name = "Runtrackeruser.findByEmail", query = "SELECT r FROM Runtrackeruser r WHERE r.email = :email"),
    @NamedQuery(name = "Runtrackeruser.findByPassword", query = "SELECT r FROM Runtrackeruser r WHERE r.password = :password")})
public class Runtrackeruser implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Size(max = 30)
    @Column(name = "FIRSTNAME", length = 30)
    private String firstname;
    @Size(max = 30)
    @Column(name = "SURNAME", length = 30)
    private String surname;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 60)
    @Column(name = "EMAIL", length = 60)
    private String email;
    @Size(max = 30)
    @Column(name = "PASSWORD", length = 30)
    private String password;

    public Runtrackeruser() {
    }

    public Runtrackeruser(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Runtrackeruser)) {
            return false;
        }
        Runtrackeruser other = (Runtrackeruser) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities_wegan.Runtrackeruser[ id=" + id + " ]";
    }
    
}
